﻿//
// Define the view's interface seen by the model.
//

using System;
using System.Collections;
using System.IO;
using FileTreeSpace;
using Progress;

namespace TravViewed
{
    public interface IAppView
    {
        ProgressModel MakeProgressDialog (string title);

        string AddressText { get; set; }

        void ShowMessage (string message, string caption);
        bool ShowQuestion (string message, string caption);

        bool InvokeRequired ();
        void Invoke (Delegate del, object[] ob);
    }


    public interface IDetailView
    {
        void SelectNone ();
        void Select ();

        int Count { get; }
        IEnumerable FullNames { get; }

        int SelectedCount { get; }
        IEnumerable SelectedFullNames { get; }

        string BaseName (int index);
        string FullName (int index);
        string FullPathName (int index);
        long FileSize (int index);
        string Hash (int index);
        DateTime ModifyDate (int index);
        bool IsSelected (int index);
        int SelectionIndex (int index);

        // Interfaced observer handlers.  These could alternatively be implemented as event subscribers.

        void SetBaseName (int index, string newValue);
        void SetFullPathName (int index, string newValue);
        void SetFileSize (int index, long newValue);
        void SetHash (int index, string newHash);
        void SetModifyDate (int index, DateTime newValue);
        void SetAttributes (int index, FileAttributes newValue);
        void SetIsSelected (int index, bool isSelected);
    }
}
